/*
 * Copyright (c) 2016 zhangcm. All Rights Reserved.
 */
package com.jnzc.ocr.serv.system.api.impl;

import com.jnzc.ocr.common.utils.DateUtils;
import com.jnzc.ocr.serv.system.api.SysCompanyApi;
import com.jnzc.ocr.serv.system.entity.SysCompany;
import com.jnzc.ocr.serv.system.service.SysCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhangcm
 * @version 1.0, 2017/8/31
 */
@RestController
public class SysCompanyApiImpl implements SysCompanyApi {

    @Autowired
    private SysCompanyService sysCompanyService;

    @Override
    public List<Long> listId() {
        return sysCompanyService.listId();
    }

    public SysCompany create(@RequestBody SysCompany param) {
        SysCompany obj = param;
        obj.setCreateTime(DateUtils.getNow());
        sysCompanyService.insertOne(obj);
        return obj;
    }
}
